//
//  MyJiRuTableViewCell.m
//  明和智能
//
//  Created by 李李善 on 2018/8/23.
//  Copyright © 2018年 inno. All rights reserved.
//

#import "MyJiRuTableViewCell.h"

@implementation MyJiRuTableViewCell

-(void)onAsInitAddView:(UIView *)view forViewController:(UIViewController *)ViewController forDataSource:(id)dataSource AtIndexPath:(NSIndexPath *)indexPath
{
    
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    self.backgroundColor = [UIColor clearColor];
 
    UILabel *label = ({
        UILabel *l  = [UILabel new];
        l.backgroundColor = hexCOLOR(@"FBE6CB");
        l.textAlignment = NSTextAlignmentCenter;
        l.text = @"今天 18:30";
        l.font = kSysFont(kFitW(12));
        [view addV:l];
        l;
    });
    
    
    
    UIView *bjView = ({
        UIView *l  = [UIView new];
        l.backgroundColor = [UIColor whiteColor]
        ;
        [view addV:l];
        l;
    });
    
    
    UILabel *title = ({
        UILabel *l  = [UILabel new];
        l.text = @"大润发停车场";
        l.font = kSysFont(kFitW(13));
        [bjView addV:l];
        l;
    });
    
    UIButton *wanc = ({
        UIButton *l  = [UIButton buttonWithType:UIButtonTypeCustom];
        [l setNormalTitle:@"完成"];
        l.titleLabel.font = kSysFont(kFitW(13));
        [l setNormalTitleColor:[UIColor blackColor]];
        [l setNormalImage:[UIImage imageNamed:@"tdy_youjt_icon"]];
        [bjView addV:l];
        l;
    });
    
    UIButton *che = ({
        UIButton *l  = [UIButton buttonWithType:UIButtonTypeCustom];
        [l setNormalTitle:@"粤A23123"];
        l.titleLabel.font = kSysFont(kFitW(12));
        [l setNormalTitleColor:hexCOLOR(@"B2B2B2")];
        [l setNormalImage:[UIImage imageNamed:@"jl_qiche_icon"]];
        [bjView addV:l];
        l;
    });
    
    UIButton *timer = ({
        UIButton *l  = [UIButton buttonWithType:UIButtonTypeCustom];
        [l setNormalTitle:@"2小时"];
        l.titleLabel.font = kSysFont(kFitW(12));
        [l setNormalTitleColor:hexCOLOR(@"B2B2B2")];
        [l setNormalImage:[UIImage imageNamed:@"jl_time_icon"]];
        [bjView addV:l];
        l;
    });
    
    UIButton *yuan = ({
        UIButton *l  = [UIButton buttonWithType:UIButtonTypeCustom];
        [l setNormalTitle:@"10元"];
        l.titleLabel.font = kSysFont(kFitW(12));
        [l setNormalTitleColor:hexCOLOR(@"B2B2B2")];
        [l setNormalImage:[UIImage imageNamed:@"jl_qian_icon"]];
        [bjView addV:l];
        l;
    });
    [self onMainSetSubViewFrame:^(UIView *view, CGPoint origin, CGSize size, CGPoint center) {
        
        label.size = CGSizeMake(kFitW(150),kFitH(30));
        label.left = 0;
        label.top = kFitH(15);
        
        [label viewCutRoundedOfRectCorner:UIRectCornerTopRight|UIRectCornerBottomRight cornerRadii:kFitW(15)];
        
        
        bjView.frame=  CGRectMake(kFitW(15),0,size.width-kFitW(30),kFitH(70));
        bjView.bottom = size.height;
        
        [title sizeToFit];
        title.left = kFitW(10);
        title.top = kFitH(12);
        
        [wanc sizeToFit];
        wanc.right =bjView.width-kFitW(15);
        wanc.centerY = title.centerY;
        [wanc layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleRight imageTitleSpace:1];
        
        [che sizeToFit];
        che.left =title.left;
        che.top = title.bottom+kFitH(8);
        [che layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleLeft imageTitleSpace:2];
        
        [timer sizeToFit];
        timer.left =che.right+kFitW(10);
        timer.top = title.bottom+kFitH(8);
        [timer layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleLeft imageTitleSpace:2];
        
        [yuan sizeToFit];
        yuan.left =timer.right+kFitW(10);
        yuan.top = title.bottom+kFitH(8);
        [yuan layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleLeft imageTitleSpace:2];
    }];
    
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
